<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>推手吧</title>
<link rel="stylesheet" href="__CSS__/stylet.css"/>
 <script src="__JS__/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="/Public/Js/jQuery/jquery.js"></script>
	<script type="text/javascript" src="/Public/Js/jQuery/jquery.form.js"></script>
 <script type="text/javascript" src="__JS__/scroll.js"></script>
<script src="http://api.map.baidu.com/api?v=1.2" type="text/javascript"></script> 
  
<script src="http://api.map.baidu.com/api?v=1.2" type="text/javascript"></script> 
   <script>
   function setResult(lng, lat){
       $.post("/Home/Index/setRes?lng="+lng+"&lat="+lat,{code:lng}, function(data){   })        
   }
   function setAA(pro,city){
       $.post("/Home/Index/setRes?pro="+pro+"&city="+city,{code:pro}, function(data){   })        
   }
   function ajaxRun(pro,city){
	   //alert("进来了");
	   //alert(pro);
	   $.post('/Home/Index/ajaxRe?pro='+pro+"&city="+city,{pro:pro},function(data){
		   //alert("okok");
	        //$('#result').html(data.info).show();
	        //$("#result").fadeOut(4000);
	        //alert(data);
	        //document.write(data);
	    },'json');
   }

   

           function getLocation(){
                var options={
                    enableHighAccuracy:true, 
                    maximumAge:1000
                }
                if(navigator.geolocation){
                    //浏览器支持geolocation
                    navigator.geolocation.getCurrentPosition(onSuccess,onError,options);
                }else{
                    //浏览器不支持geolocation
                    alert('您的浏览器不支持地理位置定位');
                }
            }

           //成功时
           function onSuccess(position){
                //返回用户位置
               //经度
               var longitude =position.coords.longitude;
                //纬度
               var latitude = position.coords.latitude;
               //setResult(longitude,latitude);
    		   
                
                //根据经纬度获取地理位置，不太准确，获取城市区域还是可以的
		    var map = new BMap.Map("allmap");
		     var point = new BMap.Point(longitude,latitude);
		     var gc = new BMap.Geocoder();
		     gc.getLocation(point, function(rs){
		        var addComp = rs.addressComponents;
		        alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
		        ajaxRun(addComp.province,addComp.city);
		        //setAA(addComp.province,addComp.city);
		     });

           }

           //失败时
           function onError(error){
        	   ajaxRun("1","2");
                switch(error.code){
                    case 1:
                    alert("位置服务被拒绝");
                    break;

                   case 2:
                    alert("暂时获取不到位置信息");
                    break;

                   case 3:
                    alert("获取信息超时");
                    break;

                   case 4:
                     alert("未知错误");
                    break;
                }
                

           }

           window.onload=getLocation;
          
    </script>
</head>

<body>

<div class="scroll">
	<div class="slide_01" id="slide_01">
	<volist name="banner" id="bo">
		<div class="mod_01"><a href="{$bo.url}"><img src="/Uploads/{$bo.image}" /></a><span>{$bo.title}</span></div>
	</volist>
	</div>
	<div class="dotModule_new">
		<div id="slide_01_dot"></div>
	</div>
</div>
<script type="text/javascript">

var viewwidth=document.body.clientWidth;
	$('.scroll .mod_01').css('width',viewwidth);
	$('.scroll img').css('width',viewwidth);
</script>
 <script type="text/javascript">
if(document.getElementById("slide_01")){
	var slide_01 = new ScrollPic();
	slide_01.scrollContId   = "slide_01"; //内容容器ID
	slide_01.dotListId      = "slide_01_dot";//点列表ID
	slide_01.dotOnClassName = "selected";
	slide_01.arrLeftId      = "sl_left"; //左箭头ID
	slide_01.arrRightId     = "sl_right";//右箭头ID
	slide_01.frameWidth     = document.body.clientWidth;
	slide_01.pageWidth      = document.body.clientWidth;
	slide_01.upright        = false;
	slide_01.speed          = 20;
	slide_01.space          = 30; 
	slide_01.initialize(); //初始化
}
</script>
    
    <script type="text/javascript">
$(document).ready(function() {
	
	jQuery.jqtab = function(tabtit,tab_conbox,shijian) {
		$(tab_conbox).find("li").hide();
		$(tabtit).find("li:first").addClass("thistab").show(); 
		$(tab_conbox).find("li:first").show();
	
		$(tabtit).find("li").bind(shijian,function(){
		  $(this).addClass("thistab").siblings("li").removeClass("thistab"); 
			var activeindex = $(tabtit).find("li").index(this);
			$(tab_conbox).children().eq(activeindex).show().siblings().hide();
			return false;
		});
	
	};
	/*调用方法如下：*/
	$.jqtab("#tabs","#tab_conbox","click");
	
	$.jqtab("#tabs2","#tab_conbox2","mouseenter");
	
});

</script>

    <div id="tabbox">
	
    <ul class="tabs" id="tabs" >
       
	   <volist name="sort" id="vo">
	   	<li  style="width:20%"><a href="#">{$vo.name}</a></li>
	   </volist>
    </ul>
   <script>
var limun=$("#tabs li").length;
var liwidth = '20%';
if(limun==2){liwidth = '50%';}
if(limun==3){liwidth = '33.33%';}
if(limun==4){liwidth = '25%';}
if(limun==5){liwidth = '20%';}
if(limun==6){liwidth = '16.66%';}
if(limun==7){liwidth = '14.28%';}
$("#tabs li").css('width',liwidth);
</script>  
    <ul class="tab_conbox" id="tab_conbox" style="margin-bottom:20px;">
    
    	<volist name="news" id="so">
	    	<li class="tab_con">
	    		<volist name="so" id="vo">
		    		<a href="{$vo.url}" class="list_item js_post">
						<div class="cover">
							<img  src="/Uploads/{$vo.thumb_image}" class="img js_img" />
						</div>
						<div class="cont">
							<h2 class="title js_title">{$vo.title}</h2>
							<p class="desc">{$vo.profile}</p>
						</div>
					</a>
	    		</volist>
	    		
	    	</li>
    	</volist>
   
    </ul>
    
    
    
</div>


<div style="bottom:0px;position:fixed;text-align:center;background:#fff;width:100%;color:#333;font-size:10px;">Copyright©2014-2015<br />广州市甲鸟网络科技有限公司 粤ICP备15045402号</div>
</body>
</html>
